import { View, Text } from "@tarojs/components";
import React from "react";

interface GetComBProps {
    getValA?: boolean;
    getValB: number;
}

const ComB = (props: GetComBProps) => {
    const { getValA, getValB } = props;
    return (
        <View>
            <Text>这是组件B</Text>
            <Text>{getValA}</Text>
            {getValA ? <View>{getValB}</View> : <Text>暂无数据</Text>}
        </View>
    );
};

ComB.defaultProps = {
    getValA: true,
    getValB: 12
};

export default ComB;
